<template>
	<view class="parent">
		<Meettingdetails  :meetingId="meetingId" class="Meettingdetails" :style="'height:'+this.height+'px'" />
		<view class="buttons" v-if="status">
			<button type="default" @click="submit(1)">同意</button>
			<button type="default"  @click="submit(0)">拒绝</button>
		</view>
	</view>
</template>

<script>
	import {checkMeetingByLeader} from '@/api/api_party_meeting.js'
	import meettingdetails from './meettingdetails/meettingdetails.vue'
	
	export default {
		data() {
			return {
				title: "详情",
				height:0,
				meetingId:1,
				status:''
			}
		},
		components: {
			Meettingdetails: meettingdetails,
		},
		onLoad(ars) {
			this.height=uni.getSystemInfoSync().windowHeight;
			this.status =eval(ars.status.toLocaleLowerCase())
			if(this.status){
				this.height = this.height*0.7
			}
			this.meetingId =Number.parseInt(ars.meetingId) 
		},
		onReady() {
		},
		methods: {
			submit(ars){
				let _this = this
				uni.showModal({
					title: '提示',
					content: '是否确定？',
					success: function(res) {
					if (res.confirm) {
						checkMeetingByLeader({
							 check:ars,
							 meetingId:_this.meetingId
						}).then(res=>{
							uni.redirectTo({
								url:'./partyBranchDirector',
								success: () => {
								}
							})
							uni.showToast({
								title:"审批成功",
								duration:2000,
							})
						})
						
					}
					},
				})
			}
		},
	}
</script>
<style lang="scss" scoped>
	
	/**
	 * 定义按钮样式
	 */
	@mixin button-commit {
	  background: linear-gradient(180deg, #ff5e59, #e20909);
	  color: #fff;
	}
	.parent{
		height: 100%;
		.Meettingdetails {
			height: 70%;
		}
		.buttons{
			position: fixed;
			width: 95%;
			bottom: 0;
			left: 2.5%;
			/deep/ uni-button{
				@include  button-commit;
				margin-bottom: 10px;
			}
		}
	}
	
</style>
